package org.jeecg.modules.demo.stockmanage.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.demo.stockmanage.entity.*;

import java.util.List;
import java.util.Map;

/**
 * @Description: 股东管理
 * @Author: jeecg-boot
 * @Date: 2022-01-14
 * @Version: V1.0
 */
public interface IStockManageService extends IService<StockManage> {
    /**
     * 查询股东列表
     *
     * @param
     * @return
     */
    IPage<StockManage> searchStockList(Page<StockManage> page, String stockName, String storeId);

    /**
     * 查询股东统计数据
     *
     * @param
     * @return
     */
    StockDataCount getStockDataCount(String storeId, String stockId);

    /**
     * 根据会员id获取股东信息
     *
     * @param memberId
     * @return
     */
    StockManage getByMemberId(String memberId);

    /**
     * 查询股东分红统计
     *
     * @param storeId
     * @param stockId
     * @return
     */
    StockDividendCount getStockDividendCount(String storeId, String stockId);

    /**
     * 查询股东股本统计
     *
     * @param
     * @return
     */
    StockEquityCount getStockEquityCount(String storeId, String memberId);

    /**
     * 设置股东管家
     *
     * @param id
     * @param shareholdersHousekeeperId
     */
    void updateHouseKeeper(String id, String shareholdersHousekeeperId, String shareholdersRatio, String memberRatio);

    /**
     * 删除股东管家
     *
     * @param shareholdersHousekeeperId
     */
    void deleteHouseKeeper(String shareholdersHousekeeperId);

    /**
     * 根据股东id删除股东管家
     *
     * @param stockId
     */
    void deleteHouseKeeperByStockId(String stockId);

    void updateCanWithdrawal(String stockId, Double totalDividend, Double withdrawalAmount);

    void refreshMemberQty();

    List<StockManage> getNoHousekeeperStockList(String storeId);

    void cleanShareholdersHousekeeper(String id);

    IPage<Map<String, Object>> listStockDividendRecord(String storeId, String stockId, String createTime, Integer pageNo, Integer pageSize);

    Double getStockDividendSum(String storeId, String memberId, String stockId);

    IPage<Map<String, Object>> listStockBalanceRecord(Page<Map<String, Object>> page, String storeId, String stockId, String createTime, String name);

    IPage<Map<String, Object>> listStockWidthRecord(String storeId, String stockId, String createTime, Integer pageNo, Integer pageSize);

    List<StockDividend> getListStockDividend(String stockId);
}
